package mi.payment.utils.iso8583;

public class FieldConfig {

    public static boolean MAC_IS_3DES = false;
    public static boolean MAC_CHECK_IS_3DES = true;

    public static final String MSG_HEADER_START = "60310";
    public static final String MSG_HEADER_VERSION = "100000";
    public static final int MESSAGE_HEADER_LENGTH = 6;

    public static final int SDK_8583_DATA_BCD = 0;
    public static final int SDK_8583_DATA_BIT = 1;
    public static final int SDK_8583_DATA_ASC = 2;

    public static final int SDK_8583_ALIGN_L = 0;
    public static final int SDK_8583_ALIGN_R = 1;
    public static final int SDK_8583_LEN_BCD = 0;

    public static final int[][] MessageFront =
            {
                    /* 报文长度 */ {2, SDK_8583_DATA_BIT},
                    /* TPdu    */ {10, SDK_8583_DATA_BCD},
                    /* Header  */ {12, SDK_8583_DATA_BCD}
            };

    public static int[][] FieldTypeConfig128 =
            {
                    /* FLD  00 */ {0, SDK_8583_LEN_BCD, 4, SDK_8583_DATA_BCD, SDK_8583_ALIGN_L, '0'},
                    /* FLD  01 */ {0, SDK_8583_LEN_BCD, 8, SDK_8583_DATA_BIT, SDK_8583_ALIGN_L, 0},

                    /* FLD  02 */ {2, SDK_8583_LEN_BCD, 19, SDK_8583_DATA_BCD, SDK_8583_ALIGN_L, '0'},

                    /* FLD  03 */ {0, SDK_8583_LEN_BCD, 6, SDK_8583_DATA_BCD, SDK_8583_ALIGN_L, '0'},
                    /* FLD  04 */ {0, SDK_8583_LEN_BCD, 12, SDK_8583_DATA_BCD, SDK_8583_ALIGN_R, '0'},
                    /* FLD  05 */ {0, SDK_8583_LEN_BCD, 12, SDK_8583_DATA_BCD, SDK_8583_ALIGN_R, '0'},
                    /* FLD  06 */ {0, SDK_8583_LEN_BCD, 12, SDK_8583_DATA_BCD, SDK_8583_ALIGN_R, '0'},
                    /* FLD  07 */ {0, SDK_8583_LEN_BCD, 12, SDK_8583_DATA_BCD, SDK_8583_ALIGN_R, '0'},
                    /* FLD  08 */ {0, SDK_8583_LEN_BCD, 12, SDK_8583_DATA_BCD, SDK_8583_ALIGN_R, '0'},
                    /* FLD  09 */ {0, SDK_8583_LEN_BCD, 12, SDK_8583_DATA_BCD, SDK_8583_ALIGN_R, '0'},
                    /* FLD  10 */ {0, SDK_8583_LEN_BCD, 12, SDK_8583_DATA_BCD, SDK_8583_ALIGN_R, '0'},
                    /* FLD  11 */ {0, SDK_8583_LEN_BCD, 6, SDK_8583_DATA_BCD, SDK_8583_ALIGN_R, '0'},
                    /* FLD  12 */ {0, SDK_8583_LEN_BCD, 6, SDK_8583_DATA_BCD, SDK_8583_ALIGN_L, '0'},
                    /* FLD  13 */ {0, SDK_8583_LEN_BCD, 4, SDK_8583_DATA_BCD, SDK_8583_ALIGN_L, '0'},
                    /* FLD  14 */ {0, SDK_8583_LEN_BCD, 4, SDK_8583_DATA_BCD, SDK_8583_ALIGN_L, '0'},
                    /* FLD  15 */ {0, SDK_8583_LEN_BCD, 4, SDK_8583_DATA_BCD, SDK_8583_ALIGN_L, '0'},
                    /* FLD  16 */ {0, SDK_8583_LEN_BCD, 12, SDK_8583_DATA_BCD, SDK_8583_ALIGN_R, '0'},
                    /* FLD  17 */ {0, SDK_8583_LEN_BCD, 12, SDK_8583_DATA_BCD, SDK_8583_ALIGN_R, '0'},
                    /* FLD  18 */ {0, SDK_8583_LEN_BCD, 12, SDK_8583_DATA_BCD, SDK_8583_ALIGN_R, '0'},
                    /* FLD  19 */ {0, SDK_8583_LEN_BCD, 12, SDK_8583_DATA_BCD, SDK_8583_ALIGN_R, '0'},
                    /* FLD  20 */ {0, SDK_8583_LEN_BCD, 12, SDK_8583_DATA_BCD, SDK_8583_ALIGN_R, '0'},
                    /* FLD  21 */ {0, SDK_8583_LEN_BCD, 12, SDK_8583_DATA_BCD, SDK_8583_ALIGN_R, '0'},
                    /* FLD  22 */ {0, SDK_8583_LEN_BCD, 3, SDK_8583_DATA_BCD, SDK_8583_ALIGN_R, '0'},

                    /* FLD  23 */ {0, SDK_8583_LEN_BCD, 3, SDK_8583_DATA_BCD, SDK_8583_ALIGN_R, '0'},

                    /* FLD  24 */ {0, SDK_8583_LEN_BCD, 3, SDK_8583_DATA_BCD, SDK_8583_ALIGN_R, '0'},
                    /* FLD  25 */ {0, SDK_8583_LEN_BCD, 2, SDK_8583_DATA_BCD, SDK_8583_ALIGN_L, '0'},
                    /* FLD  26 */ {0, SDK_8583_LEN_BCD, 2, SDK_8583_DATA_BCD, SDK_8583_ALIGN_R, '0'},
                    /* FLD  27 */ {0, SDK_8583_LEN_BCD, 12, SDK_8583_DATA_BCD, SDK_8583_ALIGN_R, '0'},
                    /* FLD  28 */ {0, SDK_8583_LEN_BCD, 12, SDK_8583_DATA_BCD, SDK_8583_ALIGN_R, '0'},
                    /* FLD  29 */ {0, SDK_8583_LEN_BCD, 12, SDK_8583_DATA_BCD, SDK_8583_ALIGN_R, '0'},
                    /* FLD  30 */ {0, SDK_8583_LEN_BCD, 12, SDK_8583_DATA_BCD, SDK_8583_ALIGN_R, '0'},
                    /* FLD  31 */ {0, SDK_8583_LEN_BCD, 12, SDK_8583_DATA_BCD, SDK_8583_ALIGN_R, '0'},
                    /* FLD  32 */ {2, SDK_8583_LEN_BCD, 11, SDK_8583_DATA_BCD, SDK_8583_ALIGN_L, '0'},
                    /* FLD  33 */ {0, SDK_8583_LEN_BCD, 12, SDK_8583_DATA_BCD, SDK_8583_ALIGN_R, '0'},
                    /* FLD  34 */ {0, SDK_8583_LEN_BCD, 40, SDK_8583_DATA_ASC, SDK_8583_ALIGN_L, ' '},

                    /* FLD  35 */ {2, SDK_8583_LEN_BCD, 37, SDK_8583_DATA_BCD, SDK_8583_ALIGN_L, '0'},
                    /* FLD  36 */ {3, SDK_8583_LEN_BCD, 999, SDK_8583_DATA_BIT, SDK_8583_ALIGN_L, '0'},

                    /* FLD  37 */ {0, SDK_8583_LEN_BCD, 12, SDK_8583_DATA_ASC, SDK_8583_ALIGN_R, '0'},
                    /* FLD  38 */ {0, SDK_8583_LEN_BCD, 6, SDK_8583_DATA_ASC, SDK_8583_ALIGN_R, '0'},
                    /* FLD  39 */ {0, SDK_8583_LEN_BCD, 2, SDK_8583_DATA_ASC, SDK_8583_ALIGN_R, '0'},
                    /* FLD  40 */ {0, SDK_8583_LEN_BCD, 40, SDK_8583_DATA_ASC, SDK_8583_ALIGN_L, ' '},
                    /* FLD  41 */ {0, SDK_8583_LEN_BCD, 8, SDK_8583_DATA_ASC, SDK_8583_ALIGN_L, ' '},
                    /* FLD  42 */ {0, SDK_8583_LEN_BCD, 15, SDK_8583_DATA_ASC, SDK_8583_ALIGN_L, ' '},
                    /* FLD  43 */ {0, SDK_8583_LEN_BCD, 12, SDK_8583_DATA_BCD, SDK_8583_ALIGN_R, '0'},

                    /* FLD  44 */ {2, SDK_8583_LEN_BCD, 99, SDK_8583_DATA_ASC, SDK_8583_ALIGN_L, ' '},

                    /* FLD  45 */ {0, SDK_8583_LEN_BCD, 12, SDK_8583_DATA_BCD, SDK_8583_ALIGN_R, '0'},
                    /* FLD  46 */ {0, SDK_8583_LEN_BCD, 12, SDK_8583_DATA_BCD, SDK_8583_ALIGN_R, '0'},

                    /* FLD  47 */ {3, SDK_8583_LEN_BCD, 999, SDK_8583_DATA_ASC, SDK_8583_ALIGN_R, '0'},

                    /* FLD  48 */ {3, SDK_8583_LEN_BCD, 322, SDK_8583_DATA_ASC, SDK_8583_ALIGN_L, '0'},

                    /* FLD  49 */ {0, SDK_8583_LEN_BCD, 3, SDK_8583_DATA_ASC, SDK_8583_ALIGN_L, ' '},
                    /* FLD  50 */ {0, SDK_8583_LEN_BCD, 12, SDK_8583_DATA_BCD, SDK_8583_ALIGN_R, '0'},
                    /* FLD  51 */ {0, SDK_8583_LEN_BCD, 12, SDK_8583_DATA_BCD, SDK_8583_ALIGN_R, '0'},
                    /* FLD  52 */ {0, SDK_8583_LEN_BCD, 8, SDK_8583_DATA_BIT, SDK_8583_ALIGN_L, 0},
                    /* FLD  53 */ {0, SDK_8583_LEN_BCD, 16, SDK_8583_DATA_BCD, SDK_8583_ALIGN_L, '0'},
                    /* FLD  54 */ {3, SDK_8583_LEN_BCD, 40, SDK_8583_DATA_ASC, SDK_8583_ALIGN_L, ' '},

                    /* FLD  55 */ {3, SDK_8583_LEN_BCD, 255, SDK_8583_DATA_BIT, SDK_8583_ALIGN_L, 0},

                    /* FLD  56 */ {0, SDK_8583_LEN_BCD, 12, SDK_8583_DATA_BCD, SDK_8583_ALIGN_R, '0'},
                    /* FLD  57 */ {3, SDK_8583_LEN_BCD, 999, SDK_8583_DATA_ASC, SDK_8583_ALIGN_R, '0'},
                    /* FLD  58 */ {3, SDK_8583_LEN_BCD, 100, SDK_8583_DATA_ASC, SDK_8583_ALIGN_L, ' '},

                    /* FLD  59 */ {3, SDK_8583_LEN_BCD, 999, SDK_8583_DATA_ASC, SDK_8583_ALIGN_L, '0'},

                    /* FLD  60 */ {3, SDK_8583_LEN_BCD, 17, SDK_8583_DATA_BCD, SDK_8583_ALIGN_L, '0'},
                    /* FLD  61 */ {3, SDK_8583_LEN_BCD, 29, SDK_8583_DATA_BCD, SDK_8583_ALIGN_L, '0'},
                    /* FLD  62 */ {3, SDK_8583_LEN_BCD, 999, SDK_8583_DATA_ASC, SDK_8583_ALIGN_L, ' '},

                    /* FLD  63 */ {3, SDK_8583_LEN_BCD, 163, SDK_8583_DATA_ASC, SDK_8583_ALIGN_L, ' '},
                    /* FLD  64 */ {0, SDK_8583_LEN_BCD, 8, SDK_8583_DATA_BIT, SDK_8583_ALIGN_L, 0},

                    /* FLD  65 */ {0, SDK_8583_LEN_BCD, 8, SDK_8583_DATA_BIT, SDK_8583_ALIGN_L, 0},
                    /* FLD  66 */ {2, SDK_8583_LEN_BCD, 19, SDK_8583_DATA_BCD, SDK_8583_ALIGN_L, 'F'},
                    /* FLD  67 */ {0, SDK_8583_LEN_BCD, 6, SDK_8583_DATA_BCD, SDK_8583_ALIGN_L, '0'},
                    /* FLD  68 */ {0, SDK_8583_LEN_BCD, 12, SDK_8583_DATA_BCD, SDK_8583_ALIGN_R, '0'},
                    /* FLD  69 */ {0, SDK_8583_LEN_BCD, 12, SDK_8583_DATA_BCD, SDK_8583_ALIGN_R, '0'},
                    /* FLD  70 */ {0, SDK_8583_LEN_BCD, 12, SDK_8583_DATA_BCD, SDK_8583_ALIGN_R, '0'},
                    /* FLD  71 */ {0, SDK_8583_LEN_BCD, 12, SDK_8583_DATA_BCD, SDK_8583_ALIGN_R, '0'},
                    /* FLD  72 */ {0, SDK_8583_LEN_BCD, 12, SDK_8583_DATA_BCD, SDK_8583_ALIGN_R, '0'},
                    /* FLD  73 */ {0, SDK_8583_LEN_BCD, 12, SDK_8583_DATA_BCD, SDK_8583_ALIGN_R, '0'},
                    /* FLD  74 */ {0, SDK_8583_LEN_BCD, 12, SDK_8583_DATA_BCD, SDK_8583_ALIGN_R, '0'},
                    /* FLD  75 */ {0, SDK_8583_LEN_BCD, 6, SDK_8583_DATA_BCD, SDK_8583_ALIGN_R, '0'},
                    /* FLD  76 */ {0, SDK_8583_LEN_BCD, 6, SDK_8583_DATA_BCD, SDK_8583_ALIGN_L, '0'},
                    /* FLD  77 */ {0, SDK_8583_LEN_BCD, 4, SDK_8583_DATA_BCD, SDK_8583_ALIGN_L, '0'},
                    /* FLD  78 */ {0, SDK_8583_LEN_BCD, 4, SDK_8583_DATA_BCD, SDK_8583_ALIGN_L, '0'},
                    /* FLD  79 */ {0, SDK_8583_LEN_BCD, 4, SDK_8583_DATA_BCD, SDK_8583_ALIGN_L, '0'},
                    /* FLD  80 */ {0, SDK_8583_LEN_BCD, 12, SDK_8583_DATA_BCD, SDK_8583_ALIGN_R, '0'},
                    /* FLD  81 */ {0, SDK_8583_LEN_BCD, 12, SDK_8583_DATA_BCD, SDK_8583_ALIGN_R, '0'},
                    /* FLD  82 */ {0, SDK_8583_LEN_BCD, 12, SDK_8583_DATA_BCD, SDK_8583_ALIGN_R, '0'},
                    /* FLD  83 */ {0, SDK_8583_LEN_BCD, 12, SDK_8583_DATA_BCD, SDK_8583_ALIGN_R, '0'},
                    /* FLD  84 */ {0, SDK_8583_LEN_BCD, 12, SDK_8583_DATA_BCD, SDK_8583_ALIGN_R, '0'},
                    /* FLD  85 */ {0, SDK_8583_LEN_BCD, 12, SDK_8583_DATA_BCD, SDK_8583_ALIGN_R, '0'},
                    /* FLD  86 */ {0, SDK_8583_LEN_BCD, 3, SDK_8583_DATA_BCD, SDK_8583_ALIGN_L, '0'},
                    /* FLD  87 */ {0, SDK_8583_LEN_BCD, 3, SDK_8583_DATA_BCD, SDK_8583_ALIGN_R, '0'},
                    /* FLD  88 */ {0, SDK_8583_LEN_BCD, 3, SDK_8583_DATA_ASC, SDK_8583_ALIGN_R, '0'},
                    /* FLD  89 */ {0, SDK_8583_LEN_BCD, 2, SDK_8583_DATA_BCD, SDK_8583_ALIGN_L, '0'},
                    /* FLD  90 */ {0, SDK_8583_LEN_BCD, 2, SDK_8583_DATA_BCD, SDK_8583_ALIGN_R, '0'},
                    /* FLD  91 */ {0, SDK_8583_LEN_BCD, 12, SDK_8583_DATA_BCD, SDK_8583_ALIGN_R, '0'},
                    /* FLD  92 */ {0, SDK_8583_LEN_BCD, 12, SDK_8583_DATA_BCD, SDK_8583_ALIGN_R, '0'},
                    /* FLD  93 */ {0, SDK_8583_LEN_BCD, 12, SDK_8583_DATA_BCD, SDK_8583_ALIGN_R, '0'},
                    /* FLD  94 */ {0, SDK_8583_LEN_BCD, 12, SDK_8583_DATA_BCD, SDK_8583_ALIGN_R, '0'},
                    /* FLD  95 */ {0, SDK_8583_LEN_BCD, 12, SDK_8583_DATA_BCD, SDK_8583_ALIGN_R, '0'},
                    /* FLD  96 */ {2, SDK_8583_LEN_BCD, 11, SDK_8583_DATA_BCD, SDK_8583_ALIGN_L, '0'},
                    /* FLD  97 */ {0, SDK_8583_LEN_BCD, 12, SDK_8583_DATA_BCD, SDK_8583_ALIGN_R, '0'},
                    /* FLD  98 */ {0, SDK_8583_LEN_BCD, 40, SDK_8583_DATA_ASC, SDK_8583_ALIGN_L, ' '},
                    /* FLD  99 */ {2, SDK_8583_LEN_BCD, 37, SDK_8583_DATA_BCD, SDK_8583_ALIGN_L, 'F'},
                    /* FLD 100 */ {3, SDK_8583_LEN_BCD, 104, SDK_8583_DATA_BCD, SDK_8583_ALIGN_L, 'F'},
                    /* FLD 101 */ {0, SDK_8583_LEN_BCD, 12, SDK_8583_DATA_ASC, SDK_8583_ALIGN_R, '0'},
                    /* FLD 102 */ {0, SDK_8583_LEN_BCD, 6, SDK_8583_DATA_ASC, SDK_8583_ALIGN_R, '0'},
                    /* FLD 103 */ {0, SDK_8583_LEN_BCD, 2, SDK_8583_DATA_ASC, SDK_8583_ALIGN_R, '0'},
                    /* FLD 104 */ {0, SDK_8583_LEN_BCD, 40, SDK_8583_DATA_ASC, SDK_8583_ALIGN_L, ' '},
                    /* FLD 105 */ {0, SDK_8583_LEN_BCD, 8, SDK_8583_DATA_ASC, SDK_8583_ALIGN_L, ' '},
                    /* FLD 106 */ {0, SDK_8583_LEN_BCD, 15, SDK_8583_DATA_ASC, SDK_8583_ALIGN_L, ' '},
                    /* FLD 107 */ {0, SDK_8583_LEN_BCD, 12, SDK_8583_DATA_BCD, SDK_8583_ALIGN_R, '0'},
                    /* FLD 108 */ {2, SDK_8583_LEN_BCD, 25, SDK_8583_DATA_ASC, SDK_8583_ALIGN_L, ' '},
                    /* FLD 109 */ {0, SDK_8583_LEN_BCD, 12, SDK_8583_DATA_BCD, SDK_8583_ALIGN_R, '0'},
                    /* FLD 110 */ {0, SDK_8583_LEN_BCD, 12, SDK_8583_DATA_BCD, SDK_8583_ALIGN_R, '0'},
                    /* FLD 111 */ {0, SDK_8583_LEN_BCD, 12, SDK_8583_DATA_BCD, SDK_8583_ALIGN_R, '0'},
                    /* FLD 112 */ {3, SDK_8583_LEN_BCD, 322, SDK_8583_DATA_BCD, SDK_8583_ALIGN_L, '0'},
                    /* FLD 113 */ {0, SDK_8583_LEN_BCD, 3, SDK_8583_DATA_ASC, SDK_8583_ALIGN_L, ' '},
                    /* FLD 114 */ {0, SDK_8583_LEN_BCD, 12, SDK_8583_DATA_BCD, SDK_8583_ALIGN_R, '0'},
                    /* FLD 115 */ {0, SDK_8583_LEN_BCD, 12, SDK_8583_DATA_BCD, SDK_8583_ALIGN_R, '0'},
                    /* FLD 116 */ {0, SDK_8583_LEN_BCD, 8, SDK_8583_DATA_BIT, SDK_8583_ALIGN_L, 0},
                    /* FLD 117 */ {0, SDK_8583_LEN_BCD, 16, SDK_8583_DATA_BCD, SDK_8583_ALIGN_L, '0'},
                    /* FLD 118 */ {3, SDK_8583_LEN_BCD, 40, SDK_8583_DATA_ASC, SDK_8583_ALIGN_L, ' '},
                    /* FLD 119 */ {3, SDK_8583_LEN_BCD, 255, SDK_8583_DATA_BIT, SDK_8583_ALIGN_L, 0},
                    /* FLD 120 */ {0, SDK_8583_LEN_BCD, 12, SDK_8583_DATA_BCD, SDK_8583_ALIGN_R, '0'},
                    /* FLD 121 */ {0, SDK_8583_LEN_BCD, 12, SDK_8583_DATA_BCD, SDK_8583_ALIGN_R, '0'},
                    /* FLD 122 */ {3, SDK_8583_LEN_BCD, 100, SDK_8583_DATA_ASC, SDK_8583_ALIGN_L, ' '},
                    /* FLD 123 */ {0, SDK_8583_LEN_BCD, 12, SDK_8583_DATA_BCD, SDK_8583_ALIGN_R, '0'},
                    /* FLD 124 */ {3, SDK_8583_LEN_BCD, 17, SDK_8583_DATA_BCD, SDK_8583_ALIGN_L, 'F'},
                    /* FLD 125 */ {3, SDK_8583_LEN_BCD, 29, SDK_8583_DATA_BCD, SDK_8583_ALIGN_L, 'F'},
                    /* FLD 126 */ {3, SDK_8583_LEN_BCD, 512, SDK_8583_DATA_ASC, SDK_8583_ALIGN_L, ' '},
                    /* FLD 127 */ {3, SDK_8583_LEN_BCD, 163, SDK_8583_DATA_ASC, SDK_8583_ALIGN_L, ' '},
                    /* FLD 128 */ {0, SDK_8583_LEN_BCD, 8, SDK_8583_DATA_BIT, SDK_8583_ALIGN_L, 0}
            };

}
